---
name: Switch
menu: 数据录入
---

import { Playground, Props  } from 'docz'
import Switch from "./Switch"
import Api from "./Api"


### Switch 开关
<p>在两种状态间切换时用到的开关选择器。</p>

## 基础用法
<p>基本用法，状态切换时会触发事件。</p>

<Playground>
    <div className="basis">
       <Switch />
    </div>
</Playground>

## 默认状态
<p>设置默认选中状态。</p>

<Playground>
    <div className="basis">
       <Switch defaultChecked={true}/>
       <Switch defaultChecked={false}/>
    </div>
</Playground>

## 禁用状态
<p>设置禁用状态。</p>

<Playground>
    <div className="basis">
       <Switch defaultChecked={true} disabled/>
       <Switch defaultChecked={false} disabled/>
    </div>
</Playground>

## 尺寸大小
<p>设置尺寸大小。</p>

<Playground>
    <div className="basis">
       <Switch defaultChecked={true} size={"small"}/>
       <Switch defaultChecked={false} />
    </div>
</Playground>

## 加载状态
<p>设置加载状态。</p>

<Playground>
    <div className="basis">
       <Switch defaultChecked={true} loading={true}/>
       <Switch defaultChecked={false} loading={false}/>
    </div>
</Playground>

## APi

<Api/>


